Serve the cloud console as an SPA with a prerendered shell - #1748
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-marketing | 912f90c | Commit Preview URL Branch Preview URL |
Aug 25 2026, 11:58 PM |
Contributor
Cloudflare previewTorn down — the PR is closed. |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-cloud | 912f90c | Aug 26 2026, 12:00 AM |
@executor-js/cli
@executor-js/config
@executor-js/execution
@executor-js/sdk
@executor-js/codemode-core
@executor-js/runtime-quickjs
@executor-js/plugin-file-secrets
@executor-js/plugin-graphql
@executor-js/plugin-keychain
@executor-js/plugin-mcp
@executor-js/plugin-onepassword
@executor-js/plugin-openapi
executor
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The console is 100% authenticated UI — marketing is its own Astro app and docs are a proxy — so nothing needs per-request React SSR. This enables TanStack Start's SPA mode: the shell is prerendered once at build, and document requests run the same request-middleware chain (auth redirects, session cookie rotation, hint minting) but serve that static shell instead of rendering the app in the worker.
Why now: post-#1742/#1747 traces show the remaining latency tail is worker cold-start absorbed by document requests — warm SSR documents measured 730-950ms and cold ones 1.7-3.2s, all of it
cfEdgetime. A static shell removes the per-request render entirely and drops the React app from the worker's runtime graph.Changes:
spa: { enabled: true }in the cloud vite config; the shell prerenders at build.ssr-gate.ts→doc-gate.ts: same gate, same redirects, same single-use-refresh-token cookie rotation (that part is load-bearing for session lifetime and now documented as such); it no longer threads render context, since there is no per-request render.__root.tsxdrops the loader/dehydration seam. Auth seeds from the client-readable hint cookie one frame after mount (AuthProvider's existing fallback, same as self-host); origin-derived UI readswindow.location.origin.connect-card-ssr-origine2e →connect-card-origin: the "real host, never 127.0.0.1:4000" contract is asserted on the rendered DOM now that there is no server-rendered HTML to inspect.apps/cloud/.wrangler/statealongside the dev DB: miniflare persists the Workers Cache API across runs, and the JWKS L2 cache served run N's emulator keys to run N+1 (same port block ⇒ same cache key), making every session verify fail signature and race single-use refreshes into 401s. This poisoned every second-and-later local run regardless of branch.Verified: 15/15 affected cloud e2e scenarios pass (auth-routing-flow, auth-hint, auth-session, unauthenticated-skeleton, org-slug-routing, connect-card-origin, logout-stale-session), including two consecutive runs to prove the cross-run poisoning fix. Browser recordings/traces in the runs artifacts. Typecheck/lint/format green.
Note: the deployed worker still ships the dead SSR chunks on disk (they are dynamic-import-only and never evaluated); trimming the build output is follow-up bundle work.